import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import qbui from 'qb-ui'
import { storage, sessionStorage } from './utils/storage'
import 'normalize.css'
import 'qb-ui/lib/theme-chalk/index.css'
import 'nprogress/nprogress.css'
import api from '@/service'
import utils from '@/utils/index.js'
import rules from '@/utils/rules.js'
import mixin from '@/mixins/index'
// import elementUI from 'element-ui'
/* import 'element-ui/lib/theme-chalk/index.css'
Vue.use(elementUI) */
// 引入全局filters
require('./filters')
// 引入解决js计算精度问题方法
require('./utils/math')
// 引入数值格式化库，window.numeral在index.html中引入
Vue.prototype.$numeral = window.numeral
Vue.prototype.$numSplice = (val, str = '0, 0.00') => {
    if (!!val && Number(val)) {
        let num = window.numeral(val).format(str)
        return num
    } else {
        return 0
    }
}

Vue.use(qbui)
Vue.config.productionTip = false
// 全局事件bus
Vue.prototype.$bus = new Vue()
// 全局api
Vue.prototype.$api = api
// 全局storages
Vue.prototype.$storage = storage
Vue.prototype.$sessionStorage = sessionStorage
// 引入常用的工具函数
Vue.prototype.$rules = rules
Vue.prototype.$utils = utils
// 启动开发环境devtools工具调试
if (process.env.NODE_ENV === 'development') {
    Vue.config.devtools = true
}

new Vue({
    router,
    store,
    mixin,
    render: h => h(App)
}).$mount('#app')
